/*

    real entities - a queriable text db

    Copyright (C) 2009 Eugeny Yakimovitch (at) gmail dot com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.    
    
*/

#ifndef ENTITY_H
#define ENTITY_H

#include <boost/filesystem.hpp>
#include <iostream>
#include <map>
#include <string>

#define HASH_KEY_STR "abcdefghijklmnopqrstuvwxyz"

namespace rea {
 
class entity {
private:
/*
 * Key-value pairs, extracted from file 
 * */
 std::map<std::string, std::string> pairs; 

public:
 const static int MAX_VALUE_SIZE = 65535;
 
 entity();
 entity(const boost::filesystem::path &path);
 ~entity(); 
 void md5digest(const char *path, char *result);
 void md5digest(const boost::filesystem::path &path, std::string &result);
 void parse(const char *path);
 void parse(const boost::filesystem::path &path);
 void write(const char *path);
 void write(const boost::filesystem::path &path);
};

}
#endif
